home *** CD-ROM | disk | FTP | other *** search
- ..[dt] Explains how to use XTabs 2.00 of 26may95 (XTABS.COM)
- XTABS.COM : 2.00 : 26may95
- (c) 1990,1993,1994,1995 by Andrew Stephenson
-
- XTABS began as a simple utility program to filter ASCII files and optimise
- streams of white space, reducing any mix of spaces, tabs and/or backspaces
- to a minimum form.
-
- It has since been extended in ways that seemed useful and sensible to the
- author. Today it is an "ASCII toolkit", providing several occasionally-
- lifesaving functions, including handling the small but annoying differences
- which distinguish "WordStar ASCII" from "Real ASCII".
-
- The principal extensions allow conversion from one "version" of ASCII to
- another. The choice now is to/from any mixture of:
-
- PC8 : 8-bit character set used by IBM PCs and their clones
- ASC7 : 7-bit "true" ASCII
- WSN : WordStar-DOS files (up to version 7.0 so far)
-
- In addition, outputs may also be:
-
- C_TEXT : C / C++ quoted text
- A_TEXT : ASM quoted text
-
- The basic command line is:
-
- xtabs <source_file> <destination_file> [ <optional_commands> ]
-
- By default, XTABS assumes source ('src') and destination ('dst') files are
- PC8: no fancy formatting; 8-bit characters; and characters have fixed width.
-
- ASC7 is very similar to PC8 but assumes characters are 7-bit. Any 8-bit
- characters found in the 'src' cause a single warning message, but an attempt
- is made to substitute a suitable 7-bit character for each 8-bit one found.
-
- WSN does a quick (but reasonably thorough) conversion from a WordStar 'src',
- treating document and non-doc alike. It assumes the file was "reformed" by
- WordStar itself (which is almost universally so). Naturally conversion from
- elaborate formatting to plain ASCII involves loss of subtlety (while in some
- ways improving on WordStar's own "write marked block to ASCII file"). Dot
- commands other than ".." are removed. Character width setter ".cw n" is
- obeyed. If 'dst' is also WSN, font-changes are passed on, after character
- width has been noted. By default, widths are assumed to be 1/10" normal
- (^N) and 1/12" alternate (^A). Other hidden ("symmetrical") codes are
- interpreted if useful then discarded; imbedded texts like annotations and
- footnotes are ignored and discarded. Single-character formatting codes are
- translated where feasible (binding space, soft hyphen, &c), exceptions being
- oddball cases such as ^C and ^F (&c).
-
- Hidden formatting codes which are interpreted are:
-
- soft tab
- indent
- centring
- right align
- dot leader
- paragraph numbering
- font change (font width data) -- including Alternate/Normal (^A/^N)
-
- NOTE: The quantity of space chars (&c) needed to fill a gap is calculated
- from gap size and current char width. This can yield layouts differing from
- WordStar's original screen displays (such as in right-aligned paragraphs);
- nevertheless these should be correct for the font in use. But do not mix
- fonts too freely, or the layout is likely to suffer.
-
- C_TEXT generates C/C++ compatible quoted-text source code. It is assumed
- the entire source is to be converted, as seen (less any end-of-file codes).
- One single quoted text is produced. Codes outside the range 20..126 which
- were graphics are written within the text in octal backslash notation (eg,
- "\234" == PC8 'pound sterling'); control codes representable by C notations
- \n, \f, &c are written that way; other control codes are written as macros
- (eg, ASC_ESC for 0x1B or ASCII 'Escape') whose prototype #definitions are in
- header file ASC_DEF.H (supplied). A message warns if macros are used.
-
- A_TEXT generates MASM-compatible quoted-text source code. It is assumed the
- entire source is to be converted, as seen (less any end-of-file codes). One
- single quoted text is produced. Codes which were graphics are handled in
- two ways: those whose values lie in the range 20..126 are written within the
- text normally; others are written as numerical values (eg, "value £1"
- becomes DB "value ",156,"1"). Control codes all become symbolic constants,
- defined in header file ASC_DEF.ASM (supplied). A message warns if symbolic
- constants are used.
-
- ============================================================================
- *** FEATURES:
-
- Each command is invoked by the command line argument shown below. Some take
- sub-arguments: numbers or texts, as appropriate. Letter case is ignored.
- If a mistake is detected, XTABS lists valid options.
-
- /O Overwrite existing 'dst' without permission.
-
- Without this, if 'dst' exists, the User is asked to permit
- overwriting by a simple Y/N response.
-
- /C Cut control chars (1..31) except Tab, NLine, CRet or FFeed.
-
- Character codes 1..31 (actually, 0..31), usually defined as "control
- codes", are deleted, with the exception of those listed (the minimum
- required for carriage control). Note that space (32), backspace (8)
- and ASCII tab (9) are always automatically regenerated as required,
- into a same-sized sequence of tabs and spaces.
-
- /T=n (n = 1..32, default 8 -- eg: /T=4)
-
- By default, ASCII tab causes a move to the next column whose number
- is an exact multiple of 8 (counting the first column in each line as
- 0). This command changes the multiplier to any in the range 1..32.
-
- Note that Tab is also known as HT (Horizontal Tab).
-
- /L=n (n = 0..10000, default 2 -- eg: /L=100)
- /LA
-
- Commands "/L=<number>" and "/LA" allows the User to specify how many
- spaces to leave as spaces.
-
- "/L=<number>" sets a limit: if the number of spaces exceeds it, then
- a mix of tabs and spaces is used; else, spaces are left.
-
- "/LA" leaves all spaces (or tabs &c converted to spaces) as spaces.
-
- White space at the trailing end of a line is always deleted.
-
- /G `GRddd sequences are to be interpreted as graphic value ddd.
-
- XTABS tries to distinguish between "graphic" and "control" codes.
- Graphic codes cause some kind of mark. Spaces (a special case) are
- treated as graphics.
-
- When converting from WSN to PC8 or ASC7, any graphic code in range
- 1..31 (otherwise confusable with an ordinary control code) is
- written as text. Code value decimal ddd gives sequence `GRddd,
- padded with leading 0s; so code 3 (PC8 "heart" symbol) gives `GR003.
- A warning is issued if this happens.
-
- On reading 'src' containing such a sequence when command "/G" has
- been given, the sequence is (if possible) converted to the original
- graphic code.
-
- This feature is really only useful when working to/from WSN.
-
- /Q=.. (text = C C++ or ASM -- eg: /Q=C++)
-
- If program source code is being processed, spaces inside quoted text
- must not be changed to tab/space mixes. Command "/Q=.." causes such
- texts to be treated as if command "/LA" is temporarily active.
-
- Text recognition can be set to C, C++ or MS-style assembly code. It
- is important to realise that the rules used are by no means as tight
- as those a compiler or assembler would apply, so this option should
- only be employed on debugged source code. Nevertheless, the rules
- are believed sufficient for most purposes (even detecting comments).
-
- /F=.. Format of 'src' and 'dst'
- /FS=.. Format of 'src' only
- /FD=.. Format of 'dst' only
- (text : PC8 ASC7 or WSN, default PC8 -- eg: /FS=ASC7/FD=WSN)
- ('dst' can also be C_TEXT or A_TEXT)
-
- These commands set the format of 'src' and 'dst'. Any mix is okay.
-
- For convenience, 'src' and 'dst' can be set together with "/F=..".
-
- /P Paragraphs are to be identified.
-
- Each paragraph converts to a single text line, by the elimination of
- "newlines" (except at para end). Inter-para gaps and indentations
- at para starts are kept. Details vary with designated source format
- (see /F= and /FS=, and below).
-
- *** PC8 / ASC7: New paras are recognised either because they begin
- with "white space" (mix of spaces and/or tabs) or because they are
- preceded by one or more blank lines. Recognition of a "newline" is
- complicated by the possible permutations of <cr> (Carriage Return,
- ^M), <lf> (Line Feed, ^J) and <ff> (Form Feed, ^L). The following
- are recognised if not mixed too close; some are not really expected
- to occur and are only catered to for the sake of thoroughness:
- <cr> <lf>
- <cr> <ff>
- <cr>
- <lf> <cr>
- <lf> <ff>
- <lf>
- <ff>
-
- When a newline is eliminated, all trailing white space on the line
- just ending is replaced by one space character.
-
- NB: This XTABS version does not convert ASCII paras whose lines all
- begin with an indentation; each line is treated as a one-line para.
- A later release may add "paragraph outdenting".
-
- *** WSN: "Soft spaces" and "soft returns" are eliminated, converting
- paras of all types: right-justified, right-aligned and centred. Any
- para which is indented by "soft" indents (such as by a non-zero left
- margin setting) is also converted.
-
- /CR=.. Replace all Carriage Returns (^M, ASCII 13) by.. (default CR)
- /LF=.. Replace all Line Feeds (^J, ASCII 10) by.. (default LF)
- /FF=.. Replace all Form Feeds (^L, ASCII 12) by.. (default FF)
- (text : SUPP CR LF FF SP CRLF or LFCR -- eg: /LF=SUPP/FF=CR)
-
- These three commands cause relevant codes to be replaced by whatever
- is selected, if found:
-
- SUPP suppresses the code (ie, deletes it);
- CR substitutes CR;
- LF substitutes LF;
- FF substitutes FF;
- SP substitutes one ASCII space;
- CRLF substitutes two-code sequence CR,LF; and
- LFCR substitutes two-code sequence LF,CR.
-
- Substitution is not recursive. CR->LF->FF->CR, for instance, is not
- possible in one pass of XTABS.
-
- /W=n (n=10..32000, default 70 in C_TEXT, 74 in A_TEXT -- eg: /W=100)
-
- This command only does anything useful when the destination is set
- to either C_TEXT or A_TEXT; otherwise it is obeyed then ignored.
-
- If an output line reaches the set limit after an element (character,
- macro, symbolic constant, &c) has been generated, a new line starts.
- Lines can go slightly beyond the /W= limit -- how far depends on the
- mode: in C_TEXT an overlap of 9 chars is possible; in A_TEXT, 5.
-
- /EOF Write an ASCII EOF (^Z) at the end of the output.
-
- By default, output ends when the translation of the source ends, to
- fit with modern practice. However, some older software may require
- text files to have ASCII End-Of-File characters.
-
- Note that this differs from pre-2.00 XTABS, which always output ^Z.
-
- /H Display help screen.
-
- The Help screen is displayed then XTABS quits back to DOS. Help is
- also given if an error is detected.
-
- ============================================================================
- *** HISTORY:
-
- Ver. Dated Notes
- ---- ------ -----
- 0.10 2apr90 XTABS begun. Slowly evolved as needs dictated.
- 1.30 2jan94 First general release of XTABS, via BBS.
- 1.31 5jan94 Bug fix: WSN dot cmnds not always deleted properly.
- 1.32 7jan94 Added /CR=, /LF= and /FF= commands.
- 1.33 7jan94 Polish. Added /CR=, /LF=, /FF= options SP and LFCR.
- 1.40 26may94 Added /P command.
- 1.41 1jun94 Bug fix: /P mode stuck 'on' for ASC7/PC8 src.
- 1.42 11nov94 Trivial redesign of Help screen.
- 1.50 4feb95 Added destinations C_TEXT & A_TEXT, with /W command.
- 1.51 8feb95 Polishing.
- 2.00 26may95 Radical internal rebuild. Bug fixes (eg, in WSN mode
- dot commands now recognised inside paragraphs.) New
- /EOF command (^Z no longer appended automatically).
-
- ============================================================================
- *** ACKNOWLEDGEMENTS:
-
- Thanks to Softkey International (UK) Ltd, formerly WordStar International
- (UK) Ltd, for file format information.
-
- ============================================================================
- *** THE LEGAL STUFF:
-
- Copyright (c) 1990,1993,1994,1995 by Andrew Stephenson who hereby asserts
- his right to be identified as author of this work, in accordance with the UK
- Designs and Patents Act, 1988. XTABS is "freeware". It is not in the
- public domain. You may make copies freely for NON-COMMERCIAL USE but the
- author continues to hold all rights in it. This work with all its files may
- be included on a CD-ROM provided that: either, the author is sent one (1)
- copy, at no charge to him, on each occasion of publication; or, the author
- first gives explicit permission for such inclusion.
-
- This software product runs on IBM-compatible computers under PC-DOS or its
- equivalent. Displays are monochrome text oriented. Users use this product
- entirely at their own risk: XTABS is NOT represented as being bug-free.
-
- ============================================================================
- Andrew Stephenson
-
- at: "Summerfield", Elsing Road, Lyng, Norwich, Norfolk, NR9 5RR, UK
- or: ames@deltrak.demon.co.uk
-
- who would be glad of a reaction saying whether the software worked and how
- useful it was/is/may be, to assist his enthusiasm and planning.
-
- END
-